package com.xuecheng.content.agent;

import com.xuecheng.api.media.model.dto.MediaDTO;
import com.xuecheng.common.constant.XcFeignServiceNameList;
import com.xuecheng.common.domain.response.RestResponse;
import com.xuecheng.content.agent.fallback.MediaApiAgentFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@FeignClient(value = XcFeignServiceNameList.XC_MEDIA_SERVICE,fallback = MediaApiAgentFallback.class)
// @FeignClient(value = XcFeignServiceNameList.XC_MEDIA_SERVICE,fallbackFactory = MediaApiAgentFallbackFactory.class)
public interface MediaApiAgent {

    String PRE_SUFFIX = "/media/l/";

    @GetMapping(PRE_SUFFIX+"media/{mediaId}")
    RestResponse<MediaDTO> getMediaById4s(@PathVariable Long mediaId);

}
